<?php
/*echo $_REQUEST['pro_id'];
echo $_REQUEST['project_name'];
echo $_REQUEST['project_manager'];
echo $_REQUEST['pro_description'];
echo $_REQUEST['start_date'];
echo $_REQUEST['complete_date'];
echo $_REQUEST['pro_status'];*/
		
try {
	
	if (!isset($_SESSION['addTester']) || !isset($_SESSION['addCoder'])) {
		$listcomposition = mysql_query("SELECT c.IDComposition, c.IDEmployee, c.IDProject, c.Position, c.Status, e.UserName, e.FullName, 
	        		 e.Position as PositionEmp FROM pr_composition c, employee e 
	        		 WHERE c.IDProject = ".$id." AND c.IDEmployee = e.IDEmployee");
		$tester = array();
		$coder = array();
		$listtemp = array();
		while ($row = mysql_fetch_array($listcomposition)) {
			array_push($listtemp, array($row[IDComposition],$row[IDEmployee],$row[Position], $row[Status]));
			if ($row[Status]==0) {
				if ($row[Position]==0) {
					array_push($tester, array($row[IDComposition],$row[IDEmployee],$row[UserName],$row[FullName],$row[Position],$row[Status]));
				}else{
					array_push($coder,array($row[IDComposition],$row[IDEmployee],$row[UserName],$row[FullName],$row[Position],$row[Status]));
				}
			}
			
		}
		$_SESSION['addTester'] = $tester;
		$_SESSION['addCoder'] = $coder;
		$_SESSION['listcomposition'] = $listtemp;
	}else{
		$tester = $_SESSION['addTester'];
		$coder = $_SESSION['addCoder'];
				
	}?>
	
	<table style="width: 100%;border:none;padding:none; margin-top:4px">
	            	<tr>
		            	<td style="width: 50%">
		            		<div style="font-size: 20;font-weight: bold;"><?=$l_tester_team?></div>
		            		<input type="hidden" id="listempty" value="<?=$l_list_emplty?>"/>
		            		<table cellpadding="5" cellspacing="0" style="margin-top: 1px !important;" class="rf_dt" id="addtester">
				                <tr class="table_new">
					                <td width="10%"></td>
					                <td width="40%"><?=$l_employee_name?><input type="hidden" id="username" value="<?=$l_employee_name?>"/></td>
					                <td width="40%"><?=$l_fullname?><input type="hidden" id="fullname" value="<?=$l_fullname?>"/></td>
					                <td width="10%"></td>
				                </tr>     
				                <?php 
				                if (count($tester)<=0){
				                ?>
				                <tr>
				                	<td colspan="4"><?=$l_list_emplty?></td>
				                </tr>
				                <?php
				                }else{
				                $indexT = 1;
				                foreach ($tester as $value) {?>
				                <tr>
				                	<td><?=$indexT?><input type='hidden' value="<?=$value[1]?>" /></td>
				                	<td><?=$value[2]?></td>
				                	<td><?=$value[3]?></td>
				                	<td align="center"><span onmouseover="this.style.cursor='pointer'" onmouseout="this.style.cursor='default'" onclick='removeTester(this)'><img src='images/del.png'/></span></td>
				                </tr>
				                <?php $indexT +=1;}}?>           
			            	</table>	            	
		            	</td>
		            	<td style="width: 4px"></td>
			            <td style="width: 50%">
		            		<div style="font-size: 20;font-weight: bold;"><?=$l_coder_team?></div>
		            		<table cellpadding="5" cellspacing="0" style="margin-top: 1px !important;" class="rf_dt" id="addcoder">
				                <tr  class="table_new">
					                <td width="10%"></td>
					                <td width="40%"><?=$l_employee_name?></td>
					                <td width="40%"><?=$l_fullname?></td>
					                <td width="10%"></td>
				                </tr>                
				                 <?php 
				                if (count($coder)<=0){
				                ?>
				                <tr>
				                	<td colspan="4"><?=$l_list_emplty?></td>
				                </tr>
				                <?php
				                }else{
				                $indexT = 1;
				                foreach ($coder as $value) {?>
				                <tr>
				                	<td><?=$indexT?><input type='hidden' value="<?=$value[1]?>" /></td>
				                	<td><?=$value[2]?></td>
				                	<td><?=$value[3]?></td>
				                	<td align="center"><span onmouseover="this.style.cursor='pointer'" onmouseout="this.style.cursor='default'" onclick='removeCoder(this)'><img src='images/del.png'/></span></td>
				                </tr>
				                <?php $indexT +=1;}}?> 
			            	</table>
		            	
		            	</td>
	            	<tr>
	            </table> 
	
	<?php 
} catch (Exception $e) {
	
}

?>